package com.yunfeng.learning.controller;


import com.yunfeng.learning.dto.OrderDTO;
import com.yunfeng.learning.dto.SystemNotificationDTO;
import com.yunfeng.learning.dto.UserDTO;
import com.yunfeng.learning.param.ResetPasswordParam;
import com.yunfeng.learning.param.UserRegisterParam;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.POST;

@Api(tags = "用户接口", description = "用户管理Ａpi")
@RestController
@RequestMapping(path = "/users")
public class UserController implements UserApi {

    @RequestMapping(method = POST)
    @Override
    public UserDTO userRegister(@RequestBody UserRegisterParam user) {
        return null;
    }

    @RequestMapping(path = "/{id}", method = GET)
    @Override
    public UserDTO queryUserDetail(@PathVariable String id) {
        return null;
    }

    @RequestMapping(method = GET)
    @Override
    public List<UserDTO> queryUsers(
            @RequestParam String name,
            @RequestParam String ids,
            @RequestParam(defaultValue = "1", required = false) int page,
            @RequestParam(defaultValue = "20", required = false) int pageSize) {
        return null;
    }

    @RequestMapping(path = "/{id}/password", method = POST)
    @Override
    public UserDTO resetPassword(@PathVariable String id, @RequestBody ResetPasswordParam resetPasswordParam) {
        return null;
    }

    @RequestMapping(path = "/{id}/orders", method = GET)
    @Override
    public List<OrderDTO> queryUserOrders(@PathVariable String id,
                                          @RequestParam String status,
                                          @RequestParam int page,
                                          @RequestParam int pageSize) {
        return null;
    }

    @RequestMapping(path = "/{id}/notifications", method = GET)
    @Override
    public List<SystemNotificationDTO> queryNotifications(
            @PathVariable String id,
            @RequestParam String status,
            @RequestParam(defaultValue = "1") int page,
            @RequestParam(defaultValue = "30") int pageSize) {
        return null;
    }

}
